cbuffer MatrixBuffer : register(b0) // VertexShader
{
	float4x4 worldViewProj; // start: 0
	float4x4 world; // 64
	float4x4 view; // 128
	float4x4 projection; // 192
	float3 g_CameraPosition; // 256
	float fogStart; // 268
	float fogEnd;  // 272
}

cbuffer TextureMatrix : register(b1)
{
	float4 uvTexture1a = { 0.02, 0.00, 0.00, 0.00 };
	float4 uvTexture1b = { 0.00, -0.00, 0.02, -0.00 };
}
cbuffer TextureMatrix : register(b2)
{
	float4 uvTexture2a = { 0.02, -0.00, -0.00, 0.00 };
	float4 uvTexture2b = { 0.00, 0.00, 0.02, 0.00 };
}
cbuffer TextureMatrix : register(b3)
{
	float4 uvTexture3a = { 0.00, 0.00, 0.02, 0.00 };
	float4 uvTexture3b = { 0.02, -0.00, -0.00, 0.00 };
}

cbuffer MaterialColor : register (b12)
{
	float4 materialColor = float4(0.10, 0.00, 1.00, 1.00);
}

cbuffer LightValues : register(b0) // PixelShader
{
	float4 AmbientColor : packoffset(c0); // start: 0
	float3 lightDir : packoffset(c1); // 16
	float3 SunColor : packoffset(c2); // 32
	float3 FogColor : packoffset(c3); // 48
	float modulate : packoffset(c4.x) = 1.02; // 64
	bool paintHighLines : packoffset(c4.y) = true; // 68
	float3 CameraPosition : packoffset(c5); // 80
	float gametime : packoffset(c6.x); // 92
}

texture2D xColoredTexture1_Tex : register(t0);
sampler Tex1 : register(s0);
texture2D xColoredTexture2_Tex : register(t1);
sampler Tex2 : register(s1);
texture2D xColoredTexture3_Tex : register(t2);
sampler Tex3 : register(s2);
texture2D xColoredTexture4_Tex : register(t3); // Shader 112 env
sampler Tex4 : register(s3);
//texture2D base_Tex : register(t0);
//sampler baseMap : register(s0);

texture2D TexShadowMap : register(ps, t[7]);
sampler ShadowMap : register(ps, s[7]);

struct VS_INPUT
{
	float4 Position : POSITION;
	float3 Normal : NORMAL0;
	float2 Tex : TEXCOORD0;
	float4 kColor : COLOR0;
	float4 kblend : COLOR1;
};

struct VertexToPixel
{
	float4 pos : SV_POSITION;
	float4 texCoord1 : TEXCOORD0;
	float4 texCoord2 : TEXCOORD1;
	float4 texCoord3 : TEXCOORD2;
	float4 kBlend : COLOR0;
	float4 kColor : COLOR1;
	float4 pos2 : TEXCOORD5;
	float3 normal : TEXCOORD6;
	float foger : FOG;
};